Skip to content

fix(pr-verify): allow the fallback-credit-2 beta through the capture's key proxy - #13886

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/13710-proxy-fallback-credit-beta
Nov 7, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/13710-proxy-fallback-credit-beta

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #13710

Summary

pr-verify-capture fails at "Check the probe" in about 16-21% of runs (hub measurement, ledger L404: 5 of 32, then 6 of 28). Sorting the errored probe transcripts in the lane-transcript sink by result:

  • Every one since run 42278025886, 15 runs, reads Failed to authenticate. API Error: 403 anthropic-beta values not allowed through this proxy: fallback-credit-2.
  • The older ones read 400 Credit balance is too low, from the key before its swap.

Claude Code sends fallback-credit-2 on some requests only, which fits the intermittent rate. The proxy refuses any beta its measured betas list does not hold (key-proxy.mjs:291-300). pr-verify runs that call the API directly with the same key succeed, which is why only the capture path fails.

Fix

  • docs/conventions/pr-pipeline.yaml: fallback-credit-2 is added to merge.verify-capture.proxy.betas. This is the route the proxy names for it: "add them to the config betas list to allow them" (key-proxy.mjs:299).
  • .changes/pr-pipeline/: a patch fragment.

What the beta does upstream is UNVERIFIED. Claude Code sets it itself, and the lanes that bypass the proxy already send it. Extra usage is off on every account, so a credit-related beta cannot bill.

Verification

  • scripts/check-affected.sh --tests: 11 passed, 116 skipped.
  • After the merge, the next capture on test PR 13873 passes "Check the probe", and the probe failure rate drops on later runs.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01RMa441b9qec43NvaTyiY2Z

…s key proxy

Refs: #13710

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMa441b9qec43NvaTyiY2Z
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 7, 2026 00:49
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-07T00:49:20.474198Z
We couldn’t complete this review. Comment @codex review to try again.
1247490 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 12474902a1f528954222fa6163dae295a24376de: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read both changed files in full.

  • docs/conventions/pr-pipeline.yaml:1544 adds fallback-credit-2 to merge.verify-capture.proxy.betas. The proxy reads that list through stringList(c, "betas") (key-proxy.mjs#L146). It refuses any beta outside the list with exactly the 403 the PR quotes (key-proxy.mjs#L291-L300). Adding the value is the fix the error message itself suggests.
  • The new entry passes the schema: betas is a unique array of non-empty strings (pr-pipeline.schema.json#L1410-L1415), and the value is a non-empty string not already in the list.
  • No test pins the YAML list against a fixed set. key-proxy.test.mjs builds its own BETAS fixture, and workflow.test.mjs checks only that the Claude Code version matches. So this change breaks no existing test. It also adds no test, which is acceptable for a config allowlist entry.
  • The .changes/pr-pipeline/ fragment is bump: patch and describes the fix accurately. A patch bump is the right level for widening a config allowlist to fix a failure.

Closing issue. The PR says Refs: #13710, not a closing keyword, so it closes no issue and there are no acceptance criteria to check.

Not verified by me. The 403 transcripts, the 16–21% failure rate, scripts/check-affected.sh --tests (11 passed) and the post-merge probe pass all come from the PR author. I did not confirm any of them. The PR itself marks what fallback-credit-2 does upstream as UNVERIFIED. Whether letting that beta through the proxy is acceptable is a question for the security lane.

Spend. The change spends only prepaid API credit: captures that used to fail at "Check the probe" will now run to the end. The PR states extra usage is off on every account. That is not a cost hold.

No manifest changes, no matching .claude/rules path rules, no prior findings, and no embedded instructions in the PR context.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 12474902a1f528954222fa6163dae295a24376de: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13886

I found no security issues. I read both changed files in full: the .changes/ fragment and docs/conventions/pr-pipeline.yaml.

What changed. The PR adds fallback-credit-2 to merge.verify-capture.proxy.betas (pr-pipeline.yaml#L1544). This is the list of anthropic-beta values the pr-verify key proxy lets through to the Messages API. The proxy holds the real key for a driven Claude Code session that runs pull request code.

Trust-control check. This file is a trusted path. The edited key is not one of the lane-slot, activity-effect or merge hold settings that decide what the token broker mints or what a merge hold enforces, so it widens no trust control under this lane's definition. It does widen the proxy's request allowlist by one header value, so I checked what that value can reach:

  • The header changes nothing else the proxy allows. The beta check only compares header values against the list (key-proxy.mjs#L291-L302). All the other checks still run whatever betas a request names:

    • the path allowlist (/v1/messages and count_tokens only, L58)
    • the body-keys allowlist, which this PR leaves unchanged
    • the model allowlist and the max_tokens ceiling
    • the server-tool and mcp_servers refusal (L308-L317)
    • inline-only content sources (L78)

    So the new beta cannot reach a server tool, a file or URL source, or an extra body field.

  • No path to a leak. The key never leaves the proxy process: it is read from stdin and the client credential is replaced upstream (L1-L19). A beta value doesn't change that.

  • Who can reach it. The proxy config is read from the base branch, not the head (L26). verify-authors: lane-or-owner (L1503) limits whose PRs pr-verify judges. Both hold under the owner-only threat model.

What it spends. The PR says it doesn't know what the beta does upstream, and I couldn't verify that either. Its name suggests a credit or billing effect. Even so, each run's spend is still capped by the proxy's per-job budget: token-cap: 1500000 and driver-token-cap: 6000000 (L1536-L1537). The PR states that extra usage is off on every account; that is the PR's claim, not a value I read. The beta itself changes no plan, auto-reload or payment setting. Captures that used to fail with a 403 will now go through, so this spends somewhat more prepaid API credit. That is not a hold.

No instruction text, plugin manifest, workflow or merge-hold file changed. The PR text contains no embedded directives aimed at this lane. This is the first review of this PR (blocking only: no), and there are no earlier findings.

critical-findings: 0

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 9f6ba4e Nov 7, 2026
65 of 77 checks passed
@kyle-sexton
kyle-sexton deleted the fix/13710-proxy-fallback-credit-beta branch November 7, 2026 01:02
kyle-sexton added a commit that referenced this pull request Nov 7, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMa441b9qec43NvaTyiY2Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant